import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home,
    redirect: 'item1',
    children: [
      {
        path: 'item1',
        name: 'item1',
        component: () => import('@/views/item1.vue')
      },
      {
        path: 'item2',
        name: 'item2',
        component: () => import('@/views/item2.vue')
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
